package com.structure.algorithm;

import java.util.Deque;

/**
 * Created by 乔磊 on 2015/10/28.
 */
public class MirrorBinaryTree {
    private void mirrorTree(BinaryTree pNode){
        if(pNode != null || (pNode.leftNode !=null && pNode.rightNode !=null)){
            BinaryTree tempNode = pNode.leftNode;
            pNode.leftNode = pNode.rightNode;
            pNode.rightNode = tempNode;
            if(pNode.leftNode!=null){
                mirrorTree(pNode.leftNode);
            }
            if(pNode.rightNode!=null){
                mirrorTree(pNode.rightNode);
            }
        }
    }

}
class BinaryTree{
    int mValue;
    BinaryTree leftNode;
    BinaryTree rightNode;

    public BinaryTree(int mValue) {
        this.mValue = mValue;
    }
}